<?php

namespace app\model;

use app\BaseModel;
use think\model\relation\BelongsTo;
use app\model\not_del\RatingScaleModel as NotDelRatingScaleModel;

/**
 * 任务量表因子（因子预警连续测评）
 */
class TaskContinuousEvaluationModel extends BaseModel
{
    protected $name = 'task_continuous_evaluation';

    /**
     * 关联量表
     * @return BelongsTo
     */
    public function RatingScale(): BelongsTo
    {
        return $this->belongsTo(NotDelRatingScaleModel::class, 'rating_scale_id')->bind([
            'rating_scale_name' => 'name',
        ]);
    }

    /**
     * 关联量表因子
     * @return BelongsTo
     */
    public function RatingScaleFactor(): BelongsTo
    {
        return $this->belongsTo(RatingScaleFactorModel::class,  'factor_id')->bind([
            'factor_name' => 'name',
        ]);
    }

    /**
     * 连续测评量表
     * @return BelongsTo
     */
    public function continuityRatingScale(): BelongsTo
    {
        return $this->belongsTo(NotDelRatingScaleModel::class,  'continuity_rating_scale_id')->bind([
            'continuity_rating_scale_name' => 'name',
        ]);
    }
}